package com.yd.mvc.pc.translateController;

import com.yd.app.service.pc.statisticalService.StatisticalService;
import com.yd.app.service.pc.translateService.TranslateService;
import com.yd.app.util.BusinessException;
import com.yd.domain.business.Statistical;
import com.yd.domain.commom.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 统计分析Controller
 * Created by sunxianhui on 2018/3/20.
 */
@RestController
@RequestMapping(value = "/api/translate")
public class translateController {

    @Autowired
    private TranslateService translateService;
    /**
     * 根据客户类型分页查询
     * @param pageIndex
     * @param pageSize
     * @return
     * @throws BusinessException
     */
    @RequestMapping(value ="/getList/{pageIndex}/{pageSize}",method = RequestMethod.GET)
    public PageModel getListByUser( @PathVariable("pageIndex") int pageIndex, @PathVariable("pageSize") int pageSize)throws BusinessException {
        PageModel pageModel = null;
        try {
            pageModel=translateService.getList(pageIndex,pageSize);
        } catch (Exception e) {
            e.printStackTrace();
            throw new BusinessException(500, "获取分享信息失败");
        }
        return pageModel;
    }
}
